<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCarCostsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('car_costs', function (Blueprint $table) {
            $table->id();
            $table->integer('car_id')->default(0)->comment('车辆id');
            $table->decimal('car_price',10,2)->default(0.00)->comment('车价');
            $table->decimal('purchase_tax',10,2)->default(0.00)->comment('购置税');
            $table->decimal('total_insurance_premium',10,2)->default(0.00)->comment('总保险费');
            $table->decimal('renovation_costs',10,2)->default(0.00)->comment('装修费');
            $table->decimal('gps_fee',10,2)->default(0.00)->comment('GPS费');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `car_costs` comment '车辆费用'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('car_costs');
    }
}
